package com.company.cloud.page.modules.app.controller;

import com.company.cloud.common.asserts.ValidatorUtils;
import com.company.cloud.common.bean.BaseResult;
import com.company.cloud.common.constant.BaseConstant;
import com.company.cloud.page.modules.api.models.PageComponentModel;
import com.company.cloud.page.modules.api.request.PageComponentQueryParam;
import com.company.cloud.page.modules.app.controller.req.PageComponentQueryAppParam;
import com.company.cloud.page.modules.mgr.service.WebPageComponentConfigMgrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/cms/pageComponent")
@Api(tags = "Page_App_页面组件信息")
public class PageComponentAppController {

	@Autowired
	private WebPageComponentConfigMgrService pageComponentMgrService;

	@PostMapping("/queryPageComponent")
	@ApiOperation(value = "页面组件列表查询", response = PageComponentModel.class)
	public BaseResult queryPageComponent(@RequestBody PageComponentQueryAppParam params) {
		ValidatorUtils.validate(params);
		PageComponentQueryParam pa = new PageComponentQueryParam();
		BeanUtils.copyProperties(params, pa);
		pa.setState(BaseConstant.YNEnum.YES.getCode());
//		return BaseResult.ok(pageComponentMgrService.query(pa));
		return BaseResult.ok();
	}
}
